<?php
    include_once('connect.php');
    
    $gender = $_GET['gender'];
    // $gender = '男';

    if($gender){
        $sql = "select * from goods_sort where sort_gender = '$gender'";
        $data = mysqli_query($conn, $sql);
        $list = [];
        $res = [];
        while($info = mysqli_fetch_array($data)){
            $arr = [];
            $arr['sort_gender'] = $info['sort_gender'];
            $arr['sort_name'] = $info['sort_name'];
            $arr['sort_img'] = $info['sort_img'];
            $arr['sort_part'] = $info['sort_part'];
            array_push($list, $arr);
        }
        if($arr){
            $res['status'] = true;
            $res['msg'] = '查询成功';
            $res['list'] = $list;
        }else{
            $res['status'] = false;
            $res['msg'] = '查询失败';
        }
    }else{
        echo('数据传输错误');
    }
    echo(json_encode($res));

?>